package jingtaifangfa;

public class jingtai {
    public static void main(String[] args) {
        Person p1 = new Person("xiaoming");
        System.out.println(Person.getcount());
        Person p2 = new Person("xiaohong");
        System.out.println(Person.getcount());
        Person p3 = new Person("xiaonang");
        System.out.println(Person.getcount());
    }
}
class Person{
    String name;
    public  static int count;

    public Person(String name) {
        this.name = name;
        System.out.println(this.name);
        count++;
    }

    public static int getcount(){
        return count;

    }

}
